home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 23 / striplf.zip / STRIPLF.DOC < prev    next >
Text File  |  1987-09-18  |  2KB  |  46 lines

  1.  
  2.     September 18, 1987
  3.  
  4.     striplf
  5.  
  6.     I found that AT&T MS-DOS 3.2 sends carriage return (CR) and linefeed
  7.     (LF) when a file is redirected.  I wanted to use a script file with
  8.     DEBUG like this:
  9.  
  10.         C:> debug <script
  11.  
  12.     What happened was after the first line, each line began with a LF
  13.     which caused DEBUG to declare an error.  The system continued to
  14.     expect input from the redirection, which caused it to hang!
  15.  
  16.     I wrote striplf.c to strip the LF out of a file.  Other similar
  17.     programs I'm sure exist, but I didn't know of them.  Striplf.c was
  18.     compiled using Ecosoft's ECOC C88 Compiler.
  19.  
  20.     All striplf.c does is replace the LF character with CR.
  21.  
  22.     Since the file is redirected from standard input, getchar() never
  23.     sees a CR character, only a LF.  This is then replaced with only a
  24.     CR character.
  25.  
  26.     Striplf.exe may be used at least in a couple of ways.  One is using
  27.     redirection from standard input to standard output like so:
  28.  
  29.         C:> striplf <script >script
  30.  
  31.     This definitely works for small files, but may be limited.  Beyond
  32.     the minimum file length (dependent upon clustersize) this may not
  33.     work.  Additionally, this modifies the script file which may cause
  34.     a problem with some editors if you wish to make changes to it (since
  35.     it no longer has the expected CR LF sequence.
  36.  
  37.     An alternative is to use striplf as a filter like this:
  38.  
  39.         C:> striplf <script | debug
  40.  
  41.     This should have no length limitation and does not adversely affect
  42.     the script file itself.
  43.  
  44.     Bob Inman
  45.     Allentown, PA
  46.